package com.gdyd.boot.mapper;

import com.gdyd.boot.bean.City;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ICityMapper {

    @Select("select * from city where id = #{id}")
    City findCityById(Long id);

    @Insert("insert into city(`name`,`state`,`country`) values (#{name},#{state},#{country})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    int insertCity(City city);

    //混合用，通过配置文件的方式插入数据
    int insertCityByXml(City city);
}
